<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${BaseContext }">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Professor-info JSP</title>
<!-- 引入css -->
<link rel="stylesheet" href="assets/css/amazeui.min.css">
<link rel="stylesheet" href="assets/css/app.css">
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/bootstrap-select.css">
<!-- 引入JQuery  js-->
<script src="static/js/jquery-3.2.1.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
</head>
<body>

	<!-- 顶栏  -->
	<jsp:include page="include/top.jsp"></jsp:include>

	<div class="am-g">
		<div class="am-u-sm-2">
			<!-- menu -->
			<jsp:include page="include/menu.jsp"></jsp:include>
		</div>
		<div class="am-u-sm-10">
			<!-- 个人信息面板-->
			<div class="am-panel am-panel-default">
			  	<div class="am-panel-hd">
			  		<a href="professor/index.do">首页</a> / <a href="professor/info.do">个人信息</a>
			  	</div>
			  	<div class="am-panel-bd">
					<!-- info-form -->
					<form class="am-form" id="updateForm" action="professor/completeInfo.do" method="post" enctype="multipart/form-data">
							<p><img class="am-circle am-center" src="${professor.pHeadUrl }" width="140" height="140"/></p>
							<div class="am-form-group am-form-file">
								<button type="button" class="am-btn am-btn-default am-btn-sm am-fr">
									<i class="am-icon-cloud-upload"></i>选择要上传的头像图片</button>
								<input type="file" name="imgFile" id="doc-form-file">
								<input type="hidden" name="pHeadUrl" value="${professor.pHeadUrl }">
							</div>
							<div class="am-form-group">
								<p id="file-list"></p><br />
							</div>
					
							<!-- 教师编号 -->
							<div class="am-form-group">
								<input type="text" id="pId" name="pId" placeholder="编号" value="${professor.pId }" readonly="readonly">
							</div>
							<!-- 教师姓名 -->
							<div class="am-form-group">
								<input type="text" id="pName" name="pName" placeholder="姓名" value="${professor.pName }" readonly="readonly">
							</div>
							<!-- 生日 -->
							<div class="am-form-group">
								<p>
									<input type="text" class="am-form-field" id="pBirth" name="pBirth" 
										value="<fmt:formatDate value='${professor.pBirth }' pattern='yyyy-MM-dd'/>" placeholder="点击选择生日" data-am-datepicker readonly="readonly"/>
								</p>
							</div>
							<!-- 教师性别 -->
							<div class="am-form-group">
								<label class="am-radio-inline">
									<input type="radio"  value="0" name="pSex" <c:if test="${professor.pSex==0 }">checked</c:if>>男
								</label>
								<label class="am-radio-inline">
									<input type="radio" value="1" name="pSex" <c:if test="${professor.pSex==1 }">checked</c:if> >女
								</label>
							</div>
							<!-- 电话号码 -->
							<div class="am-form-group">
								<input type="text" id="pPhone" name="pPhone" placeholder="电话号码" value="${professor.pPhone }">
							</div>
							<!-- email -->
							<div class="am-form-group">
								<input type="email" id="pEmail" name="pEmail" placeholder="邮箱" value="${professor.pEmail }">
							</div>
							<!-- 学位、职称、专业 -->
							<div class="am-form-group">
								<select name="tDgree" id="pDgree">
									<option value="">--请选择学位--</option>
								  	<option value="0" <c:if test="${professor.pDgree==0 }">selected="selected"</c:if> >硕士</option>
								  	<option value="1" <c:if test="${professor.pDgree==1 }">selected="selected"</c:if> >博士</option>
								  	<option value="2" <c:if test="${professor.pDgree==2 }">selected="selected"</c:if> >博士后</option>
								</select>
								</div>
								<div class="am-form-group">
								<select name="tTitle" id="pTitle">
									<option value="">--请选择职称--</option>
								  	<option value="0" <c:if test="${professor.pTitle==0 }">selected="selected"</c:if> >副教授</option>
								  	<option value="1" <c:if test="${professor.pTitle==1 }">selected="selected"</c:if> >教授</option>
								  	<option value="2" <c:if test="${professor.pTitle==2 }">selected="selected"</c:if> >副院长</option>
								  	<option value="3" <c:if test="${professor.pTitle==3 }">selected="selected"</c:if> >院长</option>
								</select>
								</div>
							<div class="am-form-group">
								<button type="submit" id="update-btn" class="am-btn am-btn-primary am-center">完成</button>
						</div>
					</form>
					
					
				</div>
			</div>
		</div>
	</div>

	<!-- footer -->
	<jsp:include page="include/footer.jsp"></jsp:include>

</body>
<script type="text/javascript">
	$(function() {
		//上传文件显示文件名
		$('#doc-form-file').on('change', function() {
			var fileNames = '';
			$.each(this.files, function() {
				fileNames += '<span class="am-badge am-fr" title="点击取消选择文件">已选择文件：' + this.name + '</span> ';
			});
			$('#file-list').html(fileNames);

			$('.am-badge').each(function (i) {
				$(this).click(function () {
					$(this).remove();
					$('#doc-form-file').val('');
				});
			});

		});
		
	});
</script>
</html>
